package com.memora

import com.memora.seguranca.SegUser

class ExtraTagLib {
    static defaultEncodeAs = 'html'
    //static encodeAsForTags = [tagName: 'm']

	/** Dependency injection for springSecurityService. */
	def springSecurityService

	/**
	* Retorna qualquer atributo de Usuário
	*/
    def userInfo = { attrs ->

		if (springSecurityService.isLoggedIn()) {
			def user = SegUser?.get(session.SPRING_SECURITY_CONTEXT?.authentication?.principal?.id)
			out << user."$attrs.value"
		}
	}
}

